package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.AgedmallGoodsGroupShipMapper;
import org.linlinjava.litemall.db.domain.AgedmallGoodsGroupShip;
import org.linlinjava.litemall.db.domain.AgedmallGoodsGroupShipExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AgedmallGoodsGroupShipService {

    @Resource
    private AgedmallGoodsGroupShipMapper agedmallGoodsGroupShipMapper;

    public List<AgedmallGoodsGroupShip> getByMainIdAndType(Integer mainGoodsId, String groupType) {
        AgedmallGoodsGroupShipExample example = new AgedmallGoodsGroupShipExample();
        example.or().andDeletedEqualTo(false)
                .andMainGoodsIdEqualTo(mainGoodsId)
                .andGroupTypeEqualTo(groupType);
        List<AgedmallGoodsGroupShip> goodsGroupShipList = agedmallGoodsGroupShipMapper.selectByExample(example);
        return goodsGroupShipList;
    }

}
